Skip to content

feat(orchestrator): Surface Grok reasoning effort options - #5160

Draft
mwolson wants to merge 1 commit into
pingdotgg:t3code/codex-turn-mappingfrom
mwolson:feat/grok-reasoning-effort
Draft

feat(orchestrator): Surface Grok reasoning effort options#5160
mwolson wants to merge 1 commit into
pingdotgg:t3code/codex-turn-mappingfrom
mwolson:feat/grok-reasoning-effort

Conversation

@mwolson

@mwolson mwolson commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a Reasoning selector for Grok models that advertise reasoning-effort
    support, including Low, Medium, and High for Grok 4.5 on web and mobile.
  • Use each model's advertised ACP effort values and default as the source of
    truth, with a narrow Grok 4.5 fallback only when that metadata is absent.
  • Start Grok ACP with the selected --reasoning-effort value and keep this
    spawn-bound option out of the generic ACP config-option path.
  • Preserve the applied selection across session loading, runtime restore,
    started-thread composers, and durable mobile outbox delivery.
  • Document the selector and its new-thread requirement in the Grok user guide.

Problem and Fix

Problem and Why it Happened Fix
T3 Code always starts Grok at its default High effort even though Grok 4.5 supports Low, Medium, and High. Surface each Grok model's advertised effort menu through the existing provider-option UI.
Grok ACP does not expose reasoning effort as a session config option, so session/set_config_option cannot apply it. Pass the selected effort to grok agent --reasoning-effort <value> stdio when the provider process starts.
Loading an existing Grok session keeps the effort chosen at session creation, even when a later process starts with a different flag. Treat reasoning effort as session-bound, compare transitions using the effective applied value, and reject incompatible same-session changes.
Started-thread composers and queued sends could retain draft defaults or model choices that the active session never applied. Pin display and dispatch to the matching committed instance and model, recheck model changes at send time, and normalize mobile outbox delivery against a freshly read environment configuration.

Defensive Fixes

Problem and Why it Happened Fix
Pre-feature Grok 4.5 threads can omit effort while older clients normalize the verified default to explicit High. Resolve absent Grok 4.5 effort semantically to High for transition comparison and effective-selection tracking without accepting real Low/High changes.
Provider metadata can be absent or malformed, and persisted selections can drift from a model's current advertised menu. Fall back only when the effort menu is absent, reject malformed-present metadata, preserve future advertised values, and normalize unsupported stored values to the advertised default.
A durable mobile outbox item can outlive its original composer state, environment configuration, or pre-confirmation thread snapshot. Keep the environment-config atom mounted, read its latest value at delivery time, defer delivery when required configuration is unavailable, re-read the current thread after durable queue confirmation, and normalize the queued selection before settings sync and send.
Projection loading and legacy item-only thread shapes can temporarily hide the active runtime while history already proves that the thread started. Use shell history as the started-thread fallback and keep model and option locks instance-aware across web and mobile.

UI Changes

  • Before: Grok has no Reasoning section in the traits menu.
  • After: new Grok threads can select the values advertised for the chosen model.
    Started threads show their applied value and disable incompatible choices
    because changing effort requires a new thread.
  • Before and after screenshots are pending while this PR remains draft.
  • A video is not applicable because this change has no animation or timing
    behavior.

Validation

  • vp check: 0 errors and 69 inherited warnings.
  • Workspace typecheck was rerun before publication. Server and web reach only
    the inherited HttpResponseCompression.ts BodyInit error and the unrelated
    OpenInPicker.tsx duplicate React Ref error in untouched files. The mobile
    task was terminated by the runner with exit 137 in the latest run, after its
    focused suites had passed.
  • Full ACP adapter suite: 86 passed.
  • Cross-model spawn-bound regression: direct assertions confirm an explicit
    Grok 4.5 High to Grok Build Low transition is rejected while an
    option-omitting pure model change remains allowed.
  • Focused server ACP adapter, selection-transition, switch-service, Grok
    adapter, provider, and ACP-support suites: 166 passed.
  • Dynamic capability assertions confirm a future advertised turbo_v2 value
    remains valid and a stale unsupported value normalizes to the advertised
    High default.
  • Focused web suites: 64 passed.
  • Focused mobile suites: 34 passed.
  • Live AppImage validation confirmed Low starts
    grok agent --reasoning-effort low stdio, Grok session metadata records Low,
    a started thread reports the provider lock, and a new thread can select High
    successfully.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for UI changes
  • A video is not applicable because there are no animation or timing changes

Note

Surface Grok reasoning effort as a spawn-bound option in the orchestrator and UI

  • Adds GROK_REASONING_EFFORT_OPTION_ID and supporting utilities in GrokAcpSupport.ts to resolve and pass --reasoning-effort as a CLI flag when spawning the Grok agent process.
  • Extends the ACP adapter in AcpAdapterV2.ts to support spawnOptionIds on flavors, excluding those options from ACP config validation and setConfigOption calls, and logging a warning on mismatch.
  • Updates GrokProvider.ts to parse reasoning effort menus from ACP model _meta and advertise a Reasoning select capability on discovered Grok models, with a fallback for grok-4.5.
  • Blocks option changes mid-thread on both web (ChatComposer.tsx) and mobile (ThreadComposer.tsx) when the active provider requires a new thread for model changes, showing a warning toast and reverting to the committed selection.
  • Behavioral Change: reasoning effort for Grok is now applied at spawn time rather than via session config, so changing it mid-thread is blocked and requires starting a new thread.
📊 Macroscope summarized bbf8c77. 12 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5da43b82-af35-4b3c-b9ca-9f3438bf6729

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 1, 2026
Comment thread apps/web/src/components/ChatView.logic.ts
@mwolson
mwolson force-pushed the feat/grok-reasoning-effort branch from bbf8c77 to d48e1e6 Compare August 1, 2026 21:51
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Aug 1, 2026
@mwolson
mwolson force-pushed the feat/grok-reasoning-effort branch from d48e1e6 to f2dc065 Compare August 2, 2026 12:44
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Aug 2, 2026
Comment thread apps/server/src/orchestration-v2/ProviderSelectionTransition.ts Outdated
@mwolson
mwolson force-pushed the feat/grok-reasoning-effort branch from f2dc065 to 80e716c Compare August 2, 2026 13:33
Comment thread apps/mobile/src/state/use-thread-outbox-drain.ts
@mwolson
mwolson force-pushed the feat/grok-reasoning-effort branch from 80e716c to aec2a42 Compare August 2, 2026 13:53
Comment thread apps/server/src/provider/Layers/GrokProvider.ts
Comment thread apps/server/src/provider/acp/GrokAcpSupport.ts
@mwolson
mwolson force-pushed the feat/grok-reasoning-effort branch 2 times, most recently from 7880dc6 to f4e2dfb Compare August 2, 2026 16:30
@maria-rcks
maria-rcks force-pushed the t3code/codex-turn-mapping branch from a543fd4 to 378615b Compare August 3, 2026 16:01
@mwolson
mwolson force-pushed the feat/grok-reasoning-effort branch from f4e2dfb to 2bf703a Compare August 3, 2026 20:17
Comment thread apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts Outdated
@mwolson
mwolson force-pushed the feat/grok-reasoning-effort branch from 2bf703a to de862bd Compare August 3, 2026 22:15
Comment thread apps/server/src/provider/Layers/GrokProvider.ts Outdated
Advertise Grok reasoning effort from ACP model metadata, with a known grok-4.5 fallback when metadata is absent, and apply the selected CLI-safe value through the agent spawn flag.

Treat reasoning effort as a spawn-bound ACP option so active sessions reject changes, runtime restore paths preserve the applied value, and generic session configuration ignores it. Keep web and mobile selections aligned with the committed session, including durable mobile outbox delivery, while allowing cross-provider handoffs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant